# 计科1915班 0306224505 屠玉宝


import random


def balls():
    red, yellow, green = 0, 0, 0
    lst = ['红', '红', '红', '黄', '黄', '黄', '绿', '绿', '绿', '绿', '绿', '绿']
    for item in random.sample(lst, 8):
        if item == '红':
            red += 1
        elif item == '黄':
            yellow += 1
        else:
            green += 1
    return f"红球{red}个 黄球{yellow}个 绿球{green}个"


if __name__ == '__main__':
    try:
        num = int(input("请问你想随机选几次："))
        if num < 0:
            print("请输入一个正整数")
            exit()
    except Exception as e:
        print("请输入一个正整数")
        exit()

    for i in range(num):
        print(f"第{i + 1}次选择: {balls()}")
